package cn.tedu.controller;

import cn.tedu.Service.UserService;
import cn.tedu.mapper.UserMapper;
import cn.tedu.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class UserController {
    /**需求：完成用户的入库操作
     * URL：http://localhost:8090/getUserById
     * 参数：id。
     * 类型：Get
     * 返回值：user对象
     * 难点：前后端交互
     */

    @Autowired
    private  UserService userService;
    @GetMapping("getUserById")
    public User getUserById(Integer id){


        return  userService.getUserById(id);

    }
}
